
/*
This is for cash slate

*/



      // Load the Visualization API and the piechart package.
      google.load('visualization', '1', {'packages':['piechart']});
      
      // Set a callback to run when the API is loaded.
      google.setOnLoadCallback(initialize);

                         



function initialize() {
    confirm(google)
  // Replace the data source URL on next line with your data source URL.
  var query = new google.visualization.Query('http://localhost:8080/');
  
  // Optional request to return only column C and the sum of column B, grouped by C members.
  //query.setQuery('select C, sum(B) group by C');
  
  // Send the query with a callback function.
  query.send(handleQueryResponse);
}

function handleQueryResponse(response) {

  if (response.isError()) {
    alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
    return;
  }

  var data = response.getDataTable();
  var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
  chart.draw(data, {width: 400, height: 240, is3D: true});
}

